package com.hqyj.hrms.modules.recruitment.controller;


import com.hqyj.hrms.modules.recruitment.entity.Apply;
import com.hqyj.hrms.modules.recruitment.service.IApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-09-26
 */
@RestController
@RequestMapping("/apply")
public class ApplyController {

    @Autowired
    IApplyService applyService;

    //新增
    @GetMapping("/add")
    public HashMap<String,Object> add(Apply apply){
        return applyService.applyAdd(apply);
    }

    //修改
    @GetMapping("/update")
    public HashMap<String,Object> update(Apply apply){
        return applyService.applyUpdate(apply);
    }

    //删除
    @GetMapping("/del")
    public HashMap<String,Object> delete(Integer id){
        return applyService.applyDel(id);
    }

    //查询
    @GetMapping("/list")
    public HashMap<String,Object> list(Apply apply){
        return applyService.applyList(apply);
    }

    @GetMapping("/list01")
    public HashMap<String,Object> list01(Apply apply){
        return applyService.applyList01(apply);
    }

    @GetMapping("/list02")
    public HashMap<String,Object> list02(Apply apply){
        return applyService.applyList02(apply);
    }

    @GetMapping("/list03")
    public HashMap<String,Object> list03(Apply apply){
        return applyService.applyList03(apply);
    }

    @GetMapping("/list04")
    public HashMap<String,Object> list04(Apply apply){
        return applyService.applyList04(apply);
    }

    @GetMapping("/list05")
    public HashMap<String,Object> list05(Apply apply){
        return applyService.applyList05(apply);
    }

    @GetMapping("/list06")
    public HashMap<String,Object> list06(Apply apply){
        return applyService.applyList06(apply);
    }

    //发送邮箱验证码
    @PostMapping("/sendEmail")
    public HashMap<String, Object> sendEmail(String email, String message,HttpServletRequest request) {
        return applyService.emailSend(email, message,request);
    }
}

